<template>
  <div>
    <div id="main"></div>
  </div>
</template>
<script>
import { reportsType } from "../tools/ajax";

import * as echarts from "echarts";
import { onMounted } from "vue";

export default {
  name: "ReportView",
  setup(props) {
    onMounted(() => {
      let chartDom = document.getElementById("main");
      let myChart = echarts.init(chartDom);
      reportsType().then((res) => {
        console.log(res.data);
        res.data.title={}
        res.data.title.text="用户来源"
        myChart.setOption(res.data);
      });
      
    });
    return {};
  },
};
</script>
<style scoped lang="less">
#main {
  width: 1000px;
  height: 500px;
}
</style>